#include "junix.h"
using namespace std;

struct A {
	virtual void f() = 0;
};

struct B {
	virtual void f() = 0;
};

struct A_impl : public A {
	void f() {
		f_impl();
	}

	void f_impl() {
		cout<<"A::f()\n";
	}
};


struct B_impl : public B {
	void f() {
		f_impl();
	}

	void f_impl() {
		cout<<"B::f()\n";
	}
};



struct C:public A_impl,public B_impl {
};

int main(int argc, char **argv)
{
	A * pa = new C;
	pa->f();
	
	B *pb = new C;
	pb->f();
}
